3.20 \(\int (a+a \sin (e+f x)) (A+B \sin (e+f x)) (c-c \sin (e+f x)) \, dx\)

Optimal. Leaf size=49 \[ \frac{a A c \sin (e+f x) \cos (e+f x)}{2 f}+\frac{1}{2} a A c x-\frac{a B c \cos ^3(e+f x)}{3 f} \]

[Out]

(a*A*c*x)/2 - (a*B*c*Cos[e + f*x]^3)/(3*f) + (a*A*c*Cos[e + f*x]*Sin[e + f*x])/(2*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0826031, antiderivative size = 49, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 32, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.125, Rules used = {2967, 2669, 2635, 8} \[ \frac{a A c \sin (e+f x) \cos (e+f x)}{2 f}+\frac{1}{2} a A c x-\frac{a B c \cos ^3(e+f x)}{3 f} \]

Antiderivative was successfully verified.

[In]

Int[(a + a*Sin[e + f*x])*(A + B*Sin[e + f*x])*(c - c*Sin[e + f*x]),x]

[Out]

(a*A*c*x)/2 - (a*B*c*Cos[e + f*x]^3)/(3*f) + (a*A*c*Cos[e + f*x]*Sin[e + f*x])/(2*f)

Rule 2967

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*sin[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a^m*c^m, Int[Cos[e + f*x]^(2*m)*(c + d*Sin[e + f*x])^(n - m)*(A + B
*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && I
ntegerQ[m] &&  !(IntegerQ[n] && ((LtQ[m, 0] && GtQ[n, 0]) || LtQ[0, n, m] || LtQ[m, n, 0]))

Rule 2669

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> -Simp[(b*(g*Cos[
e + f*x])^(p + 1))/(f*g*(p + 1)), x] + Dist[a, Int[(g*Cos[e + f*x])^p, x], x] /; FreeQ[{a, b, e, f, g, p}, x]
&& (IntegerQ[2*p] || NeQ[a^2 - b^2, 0])

Rule 2635

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Sin[c + d*x])^(n - 1))/(d*n),
x] + Dist[(b^2*(n - 1))/n, Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integer
Q[2*n]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int (a+a \sin (e+f x)) (A+B \sin (e+f x)) (c-c \sin (e+f x)) \, dx &=(a c) \int \cos ^2(e+f x) (A+B \sin (e+f x)) \, dx\\ &=-\frac{a B c \cos ^3(e+f x)}{3 f}+(a A c) \int \cos ^2(e+f x) \, dx\\ &=-\frac{a B c \cos ^3(e+f x)}{3 f}+\frac{a A c \cos (e+f x) \sin (e+f x)}{2 f}+\frac{1}{2} (a A c) \int 1 \, dx\\ &=\frac{1}{2} a A c x-\frac{a B c \cos ^3(e+f x)}{3 f}+\frac{a A c \cos (e+f x) \sin (e+f x)}{2 f}\\ \end{align*}

Mathematica [A]  time = 0.15372, size = 48, normalized size = 0.98 \[ -\frac{a c (-3 A (\sin (2 (e+f x))-2 e+2 f x)+3 B \cos (e+f x)+B \cos (3 (e+f x)))}{12 f} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + a*Sin[e + f*x])*(A + B*Sin[e + f*x])*(c - c*Sin[e + f*x]),x]

[Out]

-(a*c*(3*B*Cos[e + f*x] + B*Cos[3*(e + f*x)] - 3*A*(-2*e + 2*f*x + Sin[2*(e + f*x)])))/(12*f)

________________________________________________________________________________________

Maple [A]  time = 0.023, size = 74, normalized size = 1.5 \begin{align*}{\frac{1}{f} \left ({\frac{Bac \left ( 2+ \left ( \sin \left ( fx+e \right ) \right ) ^{2} \right ) \cos \left ( fx+e \right ) }{3}}-Aac \left ( -{\frac{\sin \left ( fx+e \right ) \cos \left ( fx+e \right ) }{2}}+{\frac{fx}{2}}+{\frac{e}{2}} \right ) -Bac\cos \left ( fx+e \right ) +Aac \left ( fx+e \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+a*sin(f*x+e))*(A+B*sin(f*x+e))*(c-c*sin(f*x+e)),x)

[Out]

1/f*(1/3*B*a*c*(2+sin(f*x+e)^2)*cos(f*x+e)-A*a*c*(-1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)-B*a*c*cos(f*x+e)+A
*a*c*(f*x+e))

________________________________________________________________________________________

Maxima [A]  time = 0.967706, size = 99, normalized size = 2.02 \begin{align*} -\frac{3 \,{\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} A a c - 12 \,{\left (f x + e\right )} A a c + 4 \,{\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} B a c + 12 \, B a c \cos \left (f x + e\right )}{12 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))*(A+B*sin(f*x+e))*(c-c*sin(f*x+e)),x, algorithm="maxima")

[Out]

-1/12*(3*(2*f*x + 2*e - sin(2*f*x + 2*e))*A*a*c - 12*(f*x + e)*A*a*c + 4*(cos(f*x + e)^3 - 3*cos(f*x + e))*B*a
*c + 12*B*a*c*cos(f*x + e))/f

________________________________________________________________________________________

Fricas [A]  time = 1.30224, size = 112, normalized size = 2.29 \begin{align*} -\frac{2 \, B a c \cos \left (f x + e\right )^{3} - 3 \, A a c f x - 3 \, A a c \cos \left (f x + e\right ) \sin \left (f x + e\right )}{6 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))*(A+B*sin(f*x+e))*(c-c*sin(f*x+e)),x, algorithm="fricas")

[Out]

-1/6*(2*B*a*c*cos(f*x + e)^3 - 3*A*a*c*f*x - 3*A*a*c*cos(f*x + e)*sin(f*x + e))/f

________________________________________________________________________________________

Sympy [A]  time = 1.22869, size = 138, normalized size = 2.82 \begin{align*} \begin{cases} - \frac{A a c x \sin ^{2}{\left (e + f x \right )}}{2} - \frac{A a c x \cos ^{2}{\left (e + f x \right )}}{2} + A a c x + \frac{A a c \sin{\left (e + f x \right )} \cos{\left (e + f x \right )}}{2 f} + \frac{B a c \sin ^{2}{\left (e + f x \right )} \cos{\left (e + f x \right )}}{f} + \frac{2 B a c \cos ^{3}{\left (e + f x \right )}}{3 f} - \frac{B a c \cos{\left (e + f x \right )}}{f} & \text{for}\: f \neq 0 \\x \left (A + B \sin{\left (e \right )}\right ) \left (a \sin{\left (e \right )} + a\right ) \left (- c \sin{\left (e \right )} + c\right ) & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))*(A+B*sin(f*x+e))*(c-c*sin(f*x+e)),x)

[Out]

Piecewise((-A*a*c*x*sin(e + f*x)**2/2 - A*a*c*x*cos(e + f*x)**2/2 + A*a*c*x + A*a*c*sin(e + f*x)*cos(e + f*x)/
(2*f) + B*a*c*sin(e + f*x)**2*cos(e + f*x)/f + 2*B*a*c*cos(e + f*x)**3/(3*f) - B*a*c*cos(e + f*x)/f, Ne(f, 0))
, (x*(A + B*sin(e))*(a*sin(e) + a)*(-c*sin(e) + c), True))

________________________________________________________________________________________

Giac [A]  time = 1.14198, size = 78, normalized size = 1.59 \begin{align*} \frac{1}{2} \, A a c x - \frac{B a c \cos \left (3 \, f x + 3 \, e\right )}{12 \, f} - \frac{B a c \cos \left (f x + e\right )}{4 \, f} + \frac{A a c \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))*(A+B*sin(f*x+e))*(c-c*sin(f*x+e)),x, algorithm="giac")

[Out]

1/2*A*a*c*x - 1/12*B*a*c*cos(3*f*x + 3*e)/f - 1/4*B*a*c*cos(f*x + e)/f + 1/4*A*a*c*sin(2*f*x + 2*e)/f